-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding optional CUDA DLLs when installing onnxruntime_gpu #22506
base: main
Are you sure you want to change the base?
Conversation
There are some test failures, Please fix them. We will remove the "orttraining-linux-gpu-ci-pipeline". The others still need to be taking care of. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can commit the suggested changes from lintrunner.
setup.py
Outdated
if cuda_version: | ||
f.write(f"cuda_version = '{cuda_version}'\n") | ||
# cudart_versions are integers | ||
cudart_versions = find_cudart_versions(build_env=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_cudart_versions only works on Linux. I think we can add a check of linux before calling find_cudart_versions to avoid a warning message in Windows.
|
||
|
||
# Load nvidia libraries from site-packages/nvidia if the package is onnxruntime-gpu | ||
if cuda_version is not None and cuda_version != "": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my test, cuda_version is still empty string. It is imported from onnxruntime.capi.onnxruntime_validation in line 73. That class only outputs cuda_version for training as below:
onnxruntime/onnxruntime/python/onnxruntime_validation.py
Lines 100 to 102 in 29bccad
cuda_version = "" | |
if has_ortmodule: |
We can remove the line of
if has_ortmodule
there.
Description
This code change enable user to install Nvidia CUDA DLLs when installing onnxruntime_gpu. with
pip install onnxruntime_gpu[cuda_dlls]
.It will also enable onnxruntime_gpu to use dynamic libraries under site-packages/nvidia that contain .dll files for Windows and .so files for Linux by temporary updating the environmental variables within an ORT Inferencing session.
Motivation and Context
Request by